<template>
  <div class="inputbox">
     <!-- <div>
        <input type="text" placeholder="输入商品" v-model="inputText">
                   <button class="" @click="search" >搜索</button>
    </div> -->
       <van-search
      autofocus
      input-align="center"
      left-icon=""
      v-model="inputText"
      shape="round"
      background="#4fc08d"
      placeholder="请输入店铺/商品"
    />
  </div>
</template>

<script>
import {user_search} from '../../../api/index'
import eventBus from '../../../utils/eventBus'
export default {
    data() {
        return {
         data:[],
         inputText:""
         
        }
    },
    methods: {
        search(){
            user_search({searchkey:this.inputText} ).then((res)=>{
                this.data=res.data.list
            eventBus.$emit('tranferData',this.data)
        })
        }
        
    },
    mounted(){
        
    }

}
</script>

<style scoped>
    .inputbox{
        padding: 10px;
        background-color: rgb(34, 138, 202);
    }
    .inputbox input{
        height: 40px;
        width: 80%;
        border-radius: 5px;
        text-align: center;
        border: 1px solid #ccc;
        background-color: white;
    }
    button{

        width: 50px;
        height: 40px;
    }
</style>